using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BE;
using DA;

using Quadrem.ExceptionManagement;


namespace BL
{
    public class PerfilBO
    {
        #region Metodos Publicos
        public static void InsertarPerfil(Perfil oPerfil)
        {
            try
            {
                PerfilDA.InsertarPerfil(oPerfil);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
        }
        public static Int32 EliminarPerfil(long uidPerfilId)
        {
            try
            {
                return PerfilDA.EliminarPerfil(uidPerfilId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
                return -1;
            }
        }
        public static DataTable ObtenerPerfiles(String strNombre)
        {
            DataTable dtPerfiles = null;
            try
            {
                dtPerfiles = PerfilDA.ObtenerPerfiles(strNombre);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
            return dtPerfiles;
        }
        public static DataSet ObtenerMenuXPerfilId(long uidPerfilId)
        {
            DataSet dsMenu = null;
            try
            {
                dsMenu = PerfilDA.ObtenerMenuXPerfilId(uidPerfilId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
            return dsMenu;
        }
        public static DataTable ObtenerMenuPrincipal(long uidPerfilId)
        {
            DataTable dt = null;
            try
            {
                dt = PerfilDA.ObtenerMenuPrincipal(uidPerfilId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
            return dt;
        }
        public static DataTable ObtenerMenuDisponibleXPerfilId(long uidPerfilId)
        {
            DataTable dtMenu = null;
            try
            {
                dtMenu = PerfilDA.ObtenerMenuDisponibleXPerfilId(uidPerfilId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
            return dtMenu;
        }
        public static void InsertarPerfilUsuario(long uidPerfilId, long uidMenuId)
        {
            try
            {
                PerfilDA.InsertarPerfilUsuario(uidPerfilId,uidMenuId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
        }
        public static void EliminarPerfilUsuario(long uidPerfilId, long uidMenuId)
        {
            try
            {
                PerfilDA.EliminarPerfilUsuario(uidPerfilId, uidMenuId);
            }
            catch (Exception ex)
            {
                BusinessLogicBase.Publish(ex);
            }
        }
        #endregion
    }
}
